﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TTEngine;

namespace TorchesTombs
{
    public class ActionMenuItem : ToolStripMenuItem
    {
        //constructor
        public ActionMenuItem(MapObject mapObject, string action)
            : base()
        {
            MapObject = mapObject;
            Action = action;
            UpdateText();
        }

        //update text
        public void UpdateText()
        {
            if (Action == "Drop")
            {
                if (Quantity == 1)
                    Text = "Drop";
                else
                    Text = "Drop " + Quantity;
            }
            else if (IsGearItem)
                Text = Action;
            else
            {
                string s = MapObject.DisplayLabel + ": " + Action;
                if (Quantity > 0)
                    s += " " + Quantity;
                Text = s;
            }
        }

        //properties
        public MapObject MapObject { get; set; }
        public string Action { get; set; }
        public int Quantity { get; set; }
        public bool IsGearItem { get; set; }
    }
}
